package test;

import core.QAP;
import core.Solution;

public class Main {
	public static void main(String[] args) {
		//String pathFile = "chr12a.dat";
		//String pathFile = "chr18a.dat";
		//String pathFile = "esc16a.dat";
		String pathFile = "nug12.dat";
		int N = 12; //tamanho da matriz
		int rclCount = (N*N - N)/2;
		int numIterations = N*5;
		double alpha = 1;
		
		long tStart = System.currentTimeMillis();   
		Solution sol = QAP.DoQAP(pathFile, numIterations, rclCount, alpha);
		long tEnd = System.currentTimeMillis();
		long tDelta = tEnd - tStart;
		double elapsedSeconds = tDelta / 1000.0;
		
		System.out.println("Tempo: \t\t"+elapsedSeconds+" s");
		System.out.println("Permutação: \t"+sol.PrintPermutation());
		System.out.println("Custo: \t\t"+sol.getCost());
		QAP.PrintMatrix(sol.getFlux(), "Fluxo");
		QAP.PrintMatrix(sol.getDestination(), "Distância");
	}
}
